#include<iostream>
#include<string>
using namespace std;

struct Node
{
	int x, y;
	int step;
	int state;
};
bool map[21][21];
bool state[21][21][1<<14];
int N, M, L;
int mask;

Node input();
int bfs(Node n);

int main()
{
	cin>>N>>M>>L;
	int counter = 0;
	while(N!=0||M!=0||L!=0)
	{
		Node n;
		int steps;
		mask = (1<<((L - 1) * 2)) - 1;
		memset(map, false, sizeof(map));
		memset(state, false, sizeof(state));
		n = input();
		steps = bfs(n);
		cout<<"Case "<<++counter<<": "<<steps<<endl;
		//getchar();
		cin>>N>>M>>L;
	}
	return 0;
}

Node input()
{
	Node n;
	int n2;
	int x, y, x1, y1;
	cin>>x>>y;
	n.x = x;
	n.y = y;
	n.step = 0;
	n.state = 0;
	for(int i=0; i<L-1; i++)
	{
		cin>>x1>>y1;
		if(x1==x)
		{
			if(y1>y)
				n.state |= 3<<(i*2);
			else
				n.state |= 2<<(i*2);
		}
		else
		{
			if(x1>x)
				n.state |= 1<<(i*2);
			else
				n.state |= 0<<(i*2);
		}
		x = x1;
		y = y1;
	}
	state[n.x][n.y][n.state] = true;
	cin>>n2;
	for(int j=0; j<n2; j++)
	{
		cin>>x>>y;
		map[x][y] = true;
	}
	return n;
}

void move(Node n, int flag, Node* q, int &rear)
{
	int x = n.x;
	int y = n.y;
	switch(flag)
	{
	case 0: n.x--; flag = 1; break;
	case 1: n.x++; flag = 0; break;
	case 2: n.y--; flag = 3; break;
	case 3: n.y++; flag = 2; break;
	}
	if(n.x<1 || n.x>N || n.y<1 || n.y>M || map[n.x][n.y]==true)
		return;
	for(int i=0; i<L-1; i++)
	{
		int flag1 = (n.state>>(i*2))&3;
		switch(flag1)
		{
		case 0: x--; break;
		case 1: x++; break;
		case 2: y--; break;
		case 3: y++; break;
		}
		if(x==n.x&&y==n.y)
			return;
	}
	n.step += 1;
	n.state<<=2;
	n.state &= mask;
	n.state = n.state|flag;
	if(state[n.x][n.y][n.state] == false)
	{
		q[rear++] = n;
		state[n.x][n.y][n.state] = true;
	}
}

int bfs(Node n)
{
	Node q[6553600];
	int front, rear;
	front=rear=0;
	q[rear++] = n;
	while(front!=rear)
	{
		Node temp = q[front++];
		if(temp.x==1&&temp.y==1)
			return temp.step;
		
		move(temp, 0, q, rear);
		move(temp, 1, q, rear);
		move(temp, 2, q, rear);
		move(temp, 3, q, rear);
	}
	return -1;
}




/*
#include<iostream>
#include<string>
#include <queue>
using namespace std;

struct Node
{
	int x, y;
	int step;
	int state;
};
bool map[21][21];
bool state[21][21][1<<14+1];
int N, M, L;
int mask;
queue<Node> q;

Node input();
int bfs(Node n);

int main()
{
	cin>>N>>M>>L;
	int counter = 0;
	while(N!=0||M!=0||L!=0)
	{
		Node n;
		int steps;
		mask = (1<<((L - 1) * 2)) - 1;
		memset(map, false, sizeof(map));
		memset(state, false, sizeof(state));
		while(!q.empty())
			q.pop();
		n = input();
		steps = bfs(n);
		cout<<"Case "<<++counter<<": "<<steps<<endl;
		cin>>N>>M>>L;
	}
	return 0;
}

Node input()
{
	Node n;
	int n2;
	int x, y, x1, y1;
	cin>>x>>y;
	n.x = x;
	n.y = y;
	n.step = 0;
	n.state = 0;
	for(int i=0; i<L-1; i++)
	{
		cin>>x1>>y1;
		if(x1==x)
		{
			if(y1>y)
				n.state |= 3<<(i*2);
			else
				n.state |= 2<<(i*2);
		}
		else
		{
			if(x1>x)
				n.state |= 1<<(i*2);
			else
				n.state |= 0<<(i*2);
		}
		x = x1;
		y = y1;
	}
	state[n.x][n.y][n.state] = true;
	cin>>n2;
	for(int j=0; j<n2; j++)
	{
		cin>>x>>y;
		map[x][y] = true;
	}
	return n;
}

void move(Node n, int flag)
{
	int x = n.x;
	int y = n.y;
	switch(flag)
	{
	case 0: n.x--; flag = 1; break;
	case 1: n.x++; flag = 0; break;
	case 2: n.y--; flag = 3; break;
	case 3: n.y++; flag = 2; break;
	}
	if(n.x<1 || n.x>N || n.y<1 || n.y>M || map[n.x][n.y]==true)
		return;
	for(int i=0; i<L-1; i++)
	{
		int flag1 = (n.state>>(i*2))&3;
		switch(flag1)
		{
		case 0: x--; break;
		case 1: x++; break;
		case 2: y--; break;
		case 3: y++; break;
		}
		if(x==n.x&&y==n.y)
			return;
	}
	n.step += 1;
	n.state<<=2;
	n.state &= mask;
	n.state = n.state|flag;
	if(state[n.x][n.y][n.state] == false)
	{
		//q[rear++] = n;
		q.push(n);
		state[n.x][n.y][n.state] = true;
	}
}

int bfs(Node n)
{

	q.push(n);
	while(!q.empty())
	{
		Node temp = q.front();
		q.pop();
		if(temp.x==1&&temp.y==1)
			return temp.step;
		
		move(temp, 0);
		move(temp, 1);
		move(temp, 2);
		move(temp, 3);
	}
	return -1;
}
*/